local skynet = require "skynet"
local sharemap = require "sharemap"

local db = require "databasel"

function testdb()
    local mem = db.open "/home/ldg/skynet_t/test/load.lua"
    print("open:" , mem)
    t = db.get "A"
    
    for i=1,10 do
        t[i] = 100
    end

    for k,v in pairs(t) do
        print(k,v)
    end
    
    local print = print
    
    --f = db.get("A.B" , { print = function(...) print("--->",...) end })
    --f()("Hello")
    
    for i=1,10 do
        print(i, db.get("A."..tostring(math.random(10))))
    end
end


skynet.start(function()

    testdb()

--[[
    for i=1,20 do
        local sub = skynet.newservice(SERVICE_NAME, "sub")
        skynet.call(sub, "lua", "init", channel.channel)
    end
--]]

end)

